/* 聊天容器 */
.chatContainer {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

/* 聊天头部 */
.chatHeader {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px 20px;
  padding-top: 60px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.headerInfo {
  display: flex;
  align-items: center;
  gap: 15px;
}

.userInfo {
  flex: 1;
}

.userName {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.userStatus {
  font-size: 14px;
  opacity: 0.9;
}

/* 消息列表容器 */
.messagesContainer {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 100px;
}

/* 消息项 */
.messageItem {
  display: flex;
  margin-bottom: 20px;
  gap: 12px;
}

.myMessage {
  flex-direction: row-reverse;
}

.messageAvatar {
  flex-shrink: 0;
}

.messageContent {
  max-width: 70%;
  display: flex;
  flex-direction: column;
}

.myMessage .messageContent {
  align-items: flex-end;
}

.otherMessage .messageContent {
  align-items: flex-start;
}

/* 消息文本 */
.messageText {
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.4;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.myMessage .messageText {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.otherMessage .messageText {
  background: white;
  color: #333;
}

/* 消息时间 */
.messageTime {
  font-size: 12px;
  color: #999;
  margin-top: 6px;
  padding: 0 4px;
}

/* 音频消息 */
.audioMessage {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 12px 16px;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.myMessage .audioMessage {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.playButton {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: inherit;
}

.audioDuration {
  font-size: 14px;
  font-weight: 500;
}

/* 文件消息 */
.fileMessage {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.myMessage .fileMessage {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.fileMessage:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fileIcon {
  font-size: 24px;
  color: #667eea;
}

.myMessage .fileIcon {
  color: rgba(255, 255, 255, 0.8);
}

.fileInfo {
  flex: 1;
}

.fileName {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  word-break: break-all;
}

.fileSize {
  font-size: 12px;
  opacity: 0.7;
}

/* 视频消息 */
.videoMessage {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.myMessage .videoMessage {
  background: white;
}

.videoPlayer {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: 8px;
}

.videoInfo {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.05);
}

.myMessage .videoInfo {
  background: rgba(255, 255, 255, 0.1);
}

/* 输入区域 */
.inputArea {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 15px 20px;
  padding-bottom: calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid #e8e8e8;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* 录音按钮 */
.recordButton {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0f0f0;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.recordButton:hover {
  background: #e0e0e0;
}

.recordButton.recording {
  background: #ff4757;
  color: white;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.recordingTime {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
}

/* 文本输入框 */
.textInput {
  flex: 1;
  border: 1px solid #e8e8e8;
  border-radius: 22px;
  padding: 8px 16px;
  font-size: 16px;
  background: #f8f8f8;
  transition: all 0.2s ease;
}

.textInput:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 功能按钮 */
.emojiButton,
.fileButton,
.sendButton {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.emojiButton {
  background: #f0f0f0;
  color: #666;
}

.emojiButton:hover {
  background: #e0e0e0;
}

.fileButton {
  background: #f0f0f0;
  color: #666;
}

.fileButton:hover {
  background: #e0e0e0;
}

.sendButton {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.sendButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sendButton:disabled {
  background: #ccc;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

/* 表情面板 */
.emojiPanel {
  padding: 20px;
}

.emojiHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.emojiGrid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}

.emojiItem {
  font-size: 24px;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.emojiItem:hover {
  background: #f0f0f0;
  transform: scale(1.1);
}

/* 文件选择面板 */
.filePanel {
  padding: 20px;
}

.fileHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.fileOptions {
  display: flex;
  gap: 15px;
}

.fileOption {
  flex: 1;
  height: 60px;
  border: 2px dashed #ddd;
  border-radius: 12px;
  background: #f8f8f8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #666;
  transition: all 0.2s ease;
}

.fileOption:hover {
  border-color: #667eea;
  background: #f0f8ff;
  color: #667eea;
}

.fileOption span {
  font-size: 12px;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .messagesContainer {
    padding: 15px;
  }
  
  .inputArea {
    padding: 12px 15px;
  }
  
  .messageContent {
    max-width: 80%;
  }
  
  .emojiGrid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .fileOptions {
    flex-direction: column;
  }
}

/* 滚动条样式 */
.messagesContainer::-webkit-scrollbar {
  width: 4px;
}

.messagesContainer::-webkit-scrollbar-track {
  background: transparent;
}

.messagesContainer::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.messagesContainer::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

